Repository navigation
Diagnose: one list of what is wrong with a game, with fixes you can undo - #93
Merged
Merged
Conversation
Diagnose needs fixes that match on a log line and on the machine, not only on an App ID, and that cannot turn pack data into shell text. This is the schema the loader and its test will enforce; the code follows. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Upstream source shows several Wine and DXVK error lines are printed by healthy runs as well. A rule needs a way to require the confirming line. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Diagnose needs two things no module had: facts about the machine that explain a game not starting (Vulkan, a 32-bit Vulkan driver, free disk), and a record of every change it makes so Undo can put a game back exactly, even after a restart. Each check has three states. One that cannot be carried out says so and never reports ok on a guess: inside the Flatpak the host's /etc is not visible, vulkaninfo may be missing, and Flatpak Steam brings its own drivers. The snapshot store treats the app id as untrusted, since it becomes a file name, and discards entries with newlines on read as well as on write, because Undo feeds them to Steam's config. Co-Authored-By: Claude Fable 5.2 <[email protected]>
The loader was built to the stricter reading wherever the format left room. The contract now says so, and caps open-ended repeats in a log expression. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The loader for the format in docs/fix-pack.md. It is strict on purpose: launch options reach a shell, so a rule may only name an environment variable and a value from a narrow character set, one game switch, or a wrapper word to remove, and anything it does not recognise rejects the rule instead of loading with defaults. Log expressions are checked for a real literal anchor and for shapes that can run away on a long line. The user's own v1 fixes load as advice rules marked as theirs. The bundled pack starts empty; test_bundled_pack_is_clean keeps what is added honest (source URL, verified date, unique ids, no rejected rule). Co-Authored-By: Claude Fable 5.2 <[email protected]>
The built-in list offered proton_9_0, proton_8_0 and proton_7_0. Steam's names are proton_9, proton_8 and proton_7 (read from appinfo.vdf), so the picker wrote a build Steam does not know, and the launch check called a game on a real Valve build "gone". The list now holds the real names, including Proton 10, 11 and Hotfix, each with a label in the picker. Co-Authored-By: Claude Fable 5.2 <[email protected]>
One test replaced os.stat with a one-argument lambda. pytest's own calls pass follow_symlinks on 3.11 and 3.12, so the run died there; it only passed on 3.14. The patch now forwards everything to the real function. Co-Authored-By: Claude Fable 5.2 <[email protected]>
One list of findings for a game, built from the launch check, the Proton log, the fix pack and the system checks, ranked by how likely each is to be the reason the game will not start. A finding carries its evidence and, where a fix is mechanical, the actions that make it. Applying is planned as a pure before/after first, so the user sees the exact change. The write happens only if Steam's files still match what was checked, a snapshot is saved before it, a failed second write puts the first one back, and Undo refuses to overwrite later edits unless told to. Launch check findings gained ids and actions; the gathering that sat in its controller now lives in core, where disk work belongs. A game still set to an old proton_9_0 name gets a blocking finding with a one-click fix back to Steam's default. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ource 18 rules read the Proton log, 6 look at launch options, 2 are tweaks for one game. Every log string was confirmed in the upstream commit Proton 11 pins (Wine, DXVK, VKD3D-Proton) or in Proton's own script, and every remedy in the issue or documentation page the rule links to. Six planned rules were dropped while checking. Most of them matched lines that Proton prints through its log() helper, which goes to stderr and never reaches steam-<appid>.log, so they could not have fired. One needed a GE-Proton point release the format cannot express, and one matched a line that only appears in the Steam Linux Runtime's own log. tests/test_fix_pack_rules.py holds a real sample line for every log rule and a set of lines from healthy runs that no rule may match. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
A rule can now stand down when a line shows that a more exact rule covers the same failure. DXVK prints "Failed to initialize DXVK" after "No adapters found", so a missing driver gave two findings; it gives one. Proton prints its low open-files and low max_map_count warnings on every run where the value is low, also for games that work. They are advice now, not "probably the cause". Co-Authored-By: Claude Fable 5.2 <[email protected]>
…u can undo The game pane's Launch check and Known fixes buttons become one Diagnose button. Its dialog lists findings by how likely they are to be the reason the game will not start, each with its evidence and where the knowledge comes from. "Fix this" shows the launch options and Proton build before and after, applies in one click, and the last fix can be undone, also after a restart. Diagnose says when Steam is running (it rewrites its settings on exit), when the launch editor has unsaved edits, and for a Non-Steam shortcut offers the new line to copy, since the app cannot write shortcuts. The dialog is its own QML file. The launch check and fixes controllers and known_fixes.json are gone; the gathering they did lives in core. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…wraps at words A game still set to proton_9_0 was told the build was "no longer installed" and to reinstall it. Steam never had that name; an older ProtonShift wrote it. The finding says so. The row that states which log was read repeated the path in its sentence and again as evidence. Evidence lines now wrap at word boundaries when they can. Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
…iption The README's lead feature is now Diagnose; the Launch check and fixes database sections are gone with the features. The System section no longer claims live temperatures: GPU data is read at start and on Refresh. The store description listed four things and left out most of what the app does. Co-Authored-By: Claude Fable 5.2 <[email protected]>
…y boundaries Co-Authored-By: Claude Fable 5.2 <[email protected]>
…r wrong A repeat may now only repeat a single character or class: the nested repeat rule let a repeated alternation with overlapping branches through, and that backtracks exponentially. A pack may only set variables from named families. A list of forbidden names missed BASH_ENV, GCONV_PATH and others, and can never be complete. The user's own fixes were documented as free of the value limits but the code refused them, which broke values such as WINEDLLOVERRIDES. They are written single-quoted now, and the doc says what is still refused. Co-Authored-By: Claude Fable 5.2 <[email protected]>
A one-click fix must not leave the game broken. Adding a missing %command% put it after a wrapper's name, so its options became game arguments (strangle 60 -> strangle %command% 60). It now goes after the options of the wrappers that take them, after -- for gamescope and ScopeBuddy, and straight after commands that take none. Diagnose called a game set to a Steam Linux Runtime tool a missing Proton build, a native Linux game a Proton game, and a missing host driver a blocker for Flatpak Steam, which brings its own. All three now say what is true. Undo and Proton-only fixes replaced unsaved launch-option edits without a word; the editor text is kept unless the launch options changed, and Undo warns first. A write that failed twice no longer deletes the record that Undo needs. A shortcut with a missing Proton build is pointed to the picker, not told the fix is in place. The pack's limits were looser than the contract claimed. A repeat may only repeat one character or class (a repeated alternation backtracked exponentially), and a rule may only set variables from named families (the forbidden list missed BASH_ENV and others). The user's own fixes were refused for values the docs allowed; they are written single-quoted and only what quoting cannot hold is refused. The two per-game tweaks stop being offered once applied. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Diagnose: one button per game that lists what is wrong with it, with fixes you can preview and undo. It replaces the "Launch check" and "Known fixes" buttons. This is the first of three slices of the 1.4 "fix release"; nothing here bumps the version.
What it does
How it is built
docs/fix-pack.mdis the contract for the rule format, committed before the code. A rule can only set an environment variable from a narrow character set, add one game switch after%command%, remove a wrapper word, reset to Steam's default Proton, or give a manual instruction. It cannot put free text into launch options, which Steam hands to a shell.tests/test_core_safety.pycovers the rejections.core/fix_pack.py(loader and validator),core/system_checks.py(three-state checks: one that cannot run says "could not check"),core/snapshots.py(the undo store),core/diagnose.py(facts, findings, ranking),core/fix_apply.py(pure plan, then snapshot, write, verify, roll back).core/data/fix_pack.json: 26 rules (18 read the Proton log, 6 look at launch options, 2 are tweaks for one game). Every log string was confirmed in the upstream commit Proton 11 pins or in Proton's script;tests/test_fix_pack_rules.pyhas a sample line per log rule and healthy-run lines that no rule may match.controllers/diagnose_controller.pyandqml/DiagnoseDialog.qml. The launch check and fixes controllers andknown_fixes.jsonare removed.Also fixed
proton_9_0,proton_8_0,proton_7_0. Steam's names areproton_9,proton_8,proton_7(read fromappinfo.vdf). Choosing one wrote a build Steam does not know, and the launch check called real Valve builds "gone". The list now has Steam's names, including Proton 10, 11 and Hotfix; a game still carrying an old name gets a finding with a one-click fix.Removed, and why
Type
Checklist
ruff check protonshiftpasses (also with ruff 0.17.5, which main now allows)pytestpasses (1507, on Python 3.11, 3.12 and 3.14)pyside6-qmllint -I protonshift/qml protonshift/qml/**/*.qmlpasses (0 errors; warnings went from 924 to 896, the new dialog has none)CHANGELOG.mdupdated under[Unreleased](for user-facing changes)fix_pack.jsonships through the existingcore/data/*.jsonpackage-data rule. The store description in the metainfo was updated.core/shader_cache.py's_APP_ID_REorcore/scopebuddy.py's_KEY_RE: not touched. Two new boundaries of the same kind are added and tested: the fix pack's action limits (tests/test_core_safety.py) and the snapshot store's app id check (tests/test_snapshots.py).CLAUDE.mdlists them.Theme.qmlpalette: none added. Diagnose uses existing tokens only.Verification
Looked at: the dialog run against a fake Steam library (
lab/protonshift-ui-checks/fake_home.py) on the default Qt platform: the findings list, the "Fix this" preview, Apply, Undo in a fresh app process, the undo conflict with "Undo anyway", the old build-name case, a clean game, a Non-Steam shortcut (Copy in place of Apply), light mode and a second visual style. On disk, Apply changedLaunchOptionsfromPROTON_LOG=1 strangle 60 %command% %command%toPROTON_LOG=1 strangle 60 %command%and Undo restored the file byte for byte. The system checks were run read-only on a real machine (NVIDIA, Arch).Review: an independent code review of this PR found ten defects; all ten are fixed on the branch (commit 91ceb64) with tests. The ones users would have met: the fix for a missing
%command%placed it after a wrapper's name instead of its options, a game set to a Steam Linux Runtime tool was called a missing Proton build, native Linux games were diagnosed as Proton games, and Undo replaced unsaved launch-option edits without warning. The review also showed two of the pack's limits were bypassable (a repeated alternation in a log expression, and a forbidden-variable list that missed names such asBASH_ENV); the contract now only allows repeating a single character or class and only setting variables from named families.Not covered:
.exenear the top of the install folder). It errs toward treating a game as a Proton game.Breaking changes
None for stored data: the user's own fixes under
~/.config/protonshift/fixes/still load. The "Launch check" and "Known fixes" buttons are gone from the game pane; Diagnose covers both.🤖 Generated with Claude Code